package model.command;
import controller.Controller;
import controller.KeyListeners.KeyListenerSet;
import model.map.Direction;
import model.playable.Playable;
/**
 *
 * @author joseph
 */
public class Move extends PlayableCommand implements DirectionalCommand {
    private Direction direction;
    public Move(Playable playable){
        super(playable);
    }
    @Override
    public void attachToListener() {
        getListeners().attachToDirectionListener(clone());
    }
    @Override
    public Move clone() {
        return new Move(getPlayable());
    }
    @Override
    public void executeCommand() {
        ((Moveable)getPlayable()).move(getDirection());
    }
    public Direction getDirection() {
        return direction;
    }
    public void setDirection(Direction direction) {
        this.direction = direction;
    }
    @Override
    public String toString(){
        return "Move";
    }

}
